

public class Text {
    public static void main(String[] args) {
        String str1 = "abcd";
        String str2 = new String("abcd");
        String str3 = "abcd";
        System.out.println(str1 == str2);
        System.out.println(str1 == str3);
    }
}
